<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="root"></div>
    <script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
    <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
    <script type="text/babel">
        const a = 123, b = 432;
        const obj = <span>这是一个span元素</span>;
        const arr = [2, null, false, undefined, 3];
        const numbers = new Array(30);
        numbers.fill(0);
        var lis = numbers.map((item, i) => (<li key={i}>{i}</li>));
        const html = (
            <React.Fragment>
                {/*注释*/}
                <h1> {a * b} </h1>
                <p>
                    {/* 以下不会产生任何输出 */}
                    {null}
                    {undefined}
                    {false}
                </p>
                <p>
                    {/* 普通对象无法放置 */}
                    {/* {obj} */}
                </p>
                <p>
                    {/* React元素对象没问题 */}
                    {obj}
                </p>

                <p>
                    {arr}
                </p>

                <ul>
                    {lis}
                </ul>
            </React.Fragment>
        )
        // 
        ReactDOM.render(html, document.getElementById('root'))


        const url = "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2962719555,3613138778&fm=27&gp=0.jpg";
        const cls = "image";
        const div = (
            <div>
                <img src={url} className={cls} style={{
                    marginLeft: "50px",
                    width: "200px"
                }} alt="" />
            </div>
        );

        ReactDOM.render(div, document.getElementById("root"));
    </script>
</body>

</html>